-- Keymaps are automatically loaded on the VeryLazy event
-- Default keymaps that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/keymaps.lua
-- Add any additional keymaps here
--
local map = vim.keymap

-- Adding hotkeys
map.set("n", "<C-a>", "ggVG", { desc = "Select All" })

map.set("n", "C-l", "")

map.set("n", "<leader>ll", "<cmd>Lazy<cr>", { desc = "Lazy" })

map.set("n", "<leader>lg", function()
  LazyVim.lazygit({ cwd = LazyVim.root.git() })
end, { desc = "Lazygit" })

-- Deletion hotkeys
map.del("n", "<leader>`", { desc = "Switch to Other Buffer" })

map.del("n", "<A-j>", { desc = "Move Down" })
map.del("n", "<A-k>", { desc = "Move Up" })
map.del("i", "<A-j>", { desc = "Move Down" })
map.del("i", "<A-k>", { desc = "Move Up" })
map.del("v", "<A-j>", { desc = "Move Down" })
map.del("v", "<A-k>", { desc = "Move Up" })

map.del("n", "[b", { desc = "Prev Buffer" })
map.del("n", "]b", { desc = "Next Buffer" })

map.del("n", "<leader>bD", { desc = "Delete Buffer and Window" })

map.del("n", "<leader>K", { desc = "Keywordprg" })

map.del("n", "<leader>l", { desc = "Lazy" })

-- Add undo break-points
map.del("i", ",")
map.del("i", ".")
map.del("i", ";")

map.del("n", "<leader>fn", { desc = "New File" })

map.del("n", "<leader>xl", { desc = "Location List" })
map.del("n", "<leader>xq", { desc = "Quickfix List" })

map.del("n", "[q", { desc = "Previous Quickfix" })
map.del("n", "]q", { desc = "Next Quickfix" })

map.del("n", "<leader>gg", { desc = "Lazygit (Root Dir)" })
map.del("n", "<leader>gG", { desc = "Lazygit (cwd)" })
map.del("n", "<leader>gB", { desc = "Git Browse" })
map.del("n", "<leader>gL", { desc = "Lazygit Log (cwd)" })

map.del("n", "<leader>L", { desc = "LazyVim Changelog" })

map.del("n", "<leader>fT", { desc = "Terminal (cwd)" })
map.del("n", "<c-/>", { desc = "Terminal (Root Dir)" })
map.del("n", "<c-_>", { desc = "which_key_ignore" })

map.del("n", "<leader>-", { desc = "Split Window Below", remap = true })
map.del("n", "<leader>|", { desc = "Split Window Right", remap = true })
map.del("n", "<leader>wm", { desc = "Maximize Toggle" })

map.del("n", "<leader><tab><tab>", { desc = "New Tab" })
map.del("n", "<leader><tab>l", { desc = "Last Tab" })
map.del("n", "<leader><tab>o", { desc = "Close Other Tabs" })
map.del("n", "<leader><tab>f", { desc = "First Tab" })
map.del("n", "<leader><tab>]", { desc = "Next Tab" })
map.del("n", "<leader><tab>d", { desc = "Close Tab" })
map.del("n", "<leader><tab>[", { desc = "Previous Tab" })
